package com.gjy.nwpufindseats;

import com.gjy.nwpufindseats.R;
import android.app.Activity;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.style.URLSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

public class Activity_study extends Activity implements OnClickListener{
		private ImageButton ivTitleBtnLeft;
		private TextView commonTitle;
		 private TextView moblieLibrary;
		 private TextView bbs;
		 private TextView openLab;
		 private TextView xlcx;
		 private TextView xcyx;
		 private TextView jwdh;
		 private TextView xydh;
		 private TextView npuweibo;
		 private TextView npubus;
		 
		@Override
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.activity_study);
			commonTitle = (TextView) findViewById(R.id.ivTitleName);			
			commonTitle.setText("学在工大");
			ivTitleBtnLeft = (ImageButton)this.findViewById(R.id.ivTitleBtnLeft);
			ivTitleBtnLeft.setOnClickListener(this);
			
			moblieLibrary = (TextView)findViewById(R.id.moblieLibrary);
			SpannableString mLsp = new SpannableString("移动图书馆");
			mLsp.setSpan(new URLSpan("http://m.5read.com/739"), 0, 5,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			moblieLibrary.append(mLsp);
			moblieLibrary.setMovementMethod(LinkMovementMethod.getInstance());
			
			bbs = (TextView)findViewById(R.id.bbs);
			SpannableString bbssp = new SpannableString("三航四方");
			bbssp.setSpan(new URLSpan("http://bbs.nwpu.edu.cn/"), 0, 4,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			bbs.append(bbssp);
			bbs.setMovementMethod(LinkMovementMethod.getInstance());
			
			openLab = (TextView)findViewById(R.id.openLab);
			SpannableString openLabsp = new SpannableString("开放实验室");
			openLabsp.setSpan(new URLSpan("http://m.openlab.net.cn/"), 0, 5,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			openLab.append(openLabsp);
			openLab.setMovementMethod(LinkMovementMethod.getInstance());
			
			xlcx = (TextView)findViewById(R.id.xlcx);
			SpannableString xlcxssp = new SpannableString("校历查询");
			xlcxssp.setSpan(new URLSpan("http://jiaowu.nwpu.edu.cn/index/xxxl.htm"), 0, 4,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			xlcx.append(xlcxssp);
			xlcx.setMovementMethod(LinkMovementMethod.getInstance());
			
			xcyx = (TextView)findViewById(R.id.xcyx);
			SpannableString xcyxsp = new SpannableString("校车运行");
			xcyxsp.setSpan(new URLSpan("http://jiaowu.nwpu.edu.cn/index/xcyx.htm"), 0, 4,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			xcyx.append(xcyxsp);
			xcyx.setMovementMethod(LinkMovementMethod.getInstance());
			
			jwdh = (TextView)findViewById(R.id.jwdh);
			SpannableString jwdhsp = new SpannableString("教务电话");
			jwdhsp.setSpan(new URLSpan("http://jiaowu.nwpu.edu.cn/index/bgdh.htm"), 0, 4,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			jwdh.append(jwdhsp);
			jwdh.setMovementMethod(LinkMovementMethod.getInstance());
			
			xydh = (TextView)findViewById(R.id.xydh);
			SpannableString xydhsp = new SpannableString("学院电话");
			xydhsp.setSpan(new URLSpan("http://jiaowu.nwpu.edu.cn/index/lxxy.htm"), 0, 4,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			xydh.append(xydhsp);
			xydh.setMovementMethod(LinkMovementMethod.getInstance());
			
			npuweibo = (TextView )findViewById(R.id.npuweibo);
			SpannableString npuweibosp = new SpannableString("西工大官方微博");
			npuweibosp.setSpan(new URLSpan("http://m.weibo.com/npustar"), 0, 7,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			npuweibo.append(npuweibosp);
			npuweibo.setMovementMethod(LinkMovementMethod.getInstance());
			
			npubus = (TextView )findViewById(R.id.npubus);
			SpannableString npubussp = new SpannableString("瓜大直通车微博");
			npubussp.setSpan(new URLSpan("http://weibo.com/guadazhitongche"), 0, 7,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			npubus.append(npubussp);
			npubus.setMovementMethod(LinkMovementMethod.getInstance());
		}		
		public void onClick(View v) {
			switch (v.getId()) {
				case R.id.ivTitleBtnLeft:
					onBackPressed();
					break;
				default:
				break;
			}		
		}
}


